package com.xtpt.disaster.mapper;

import com.xtpt.disaster.bean.JobDetail;
import com.xtpt.disaster.bean.JobDetailExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface JobDetailMapper {
    long countByExample(JobDetailExample example);

    int deleteByExample(JobDetailExample example);

    int deleteByPrimaryKey(Long jobId);

    int insert(JobDetail record);

    int insertSelective(JobDetail record);

    List<JobDetail> selectByExample(JobDetailExample example);

    JobDetail selectByPrimaryKey(Long jobId);
    /**
     * 用于文件夹增量备份时候查询最近一次的全量备份
     * @param clientFolderPath 要备份的文件路径
     * @return
     */
    JobDetail selectByClientPath(Long nodeId, String clientFolderPath);

    int updateByExampleSelective(@Param("record") JobDetail record, @Param("example") JobDetailExample example);

    int updateByExample(@Param("record") JobDetail record, @Param("example") JobDetailExample example);

    int updateByPrimaryKeySelective(JobDetail record);

    int updateByPrimaryKey(JobDetail record);

    List<JobDetail> selectAllJobDetail();

    int deleteBatch(long[] ids);

    List<Map<String, Object>> selectCountByDay(Date jobStartTime, Date jobEndTime);
}